{extend name="base" /}
{block name="main"}
<div class="fly-panel fly-panel-user">
<div class="tpt—admin">

<div class="layui-tab">
  <ul class="layui-tab-title" style="margin-bottom: 10px;">
    <li class="layui-this">会员资料</li>
    <li>登录验证</li>
	<li>实名认证</li>
	<li>修改密码</li>
  </ul>
  <div class="layui-tab-content">
    <div class="layui-tab-item layui-show">
<form class="layui-form">
  <input type="hidden" name="userid" value="{$tptc.userid}">
  
  <div class="layui-form-item">
    <label class="layui-form-label">名称</label>
    <div class="layui-input-block">
      <input type="text" name="username" value="{$tptc.username}" placeholder="请输入内容" autocomplete="off" class="layui-input">
    </div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">性别</label>
    <div class="layui-input-block">
      <input type="radio" name="sex" value="1" title="男" {if condition="$tptc['sex'] eq 1"}checked=""{/if}>
	  <input type="radio" name="sex" value="0" title="女" {if condition="$tptc['sex'] eq 0"}checked=""{/if}>
    </div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">邮箱</label>
    <div class="layui-input-block">
	  <input type="text" name="usermail" value="{$tptc.usermail}" placeholder="请输入内容" autocomplete="off" class="layui-input">
    </div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">积分</label>
    <div class="layui-input-block">
	  <input type="text" name="point" value="{$tptc.point}" placeholder="请输入内容" autocomplete="off" class="layui-input">
    </div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">QQ</label>
    <div class="layui-input-block">
	  <input type="text" name="userqq" value="{$tptc.userqq}" placeholder="请输入内容" autocomplete="off" class="layui-input">
    </div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">城市</label>
    <div class="layui-input-block">
	  <input type="text" name="userhome" value="{$tptc.userhome}" placeholder="请输入内容" autocomplete="off" class="layui-input">
    </div>
  </div>

  <div class="layui-form-item layui-form-text">
    <label class="layui-form-label">签名</label>
    <div class="layui-input-block">
      <textarea name="description" placeholder="请输入内容" class="layui-textarea">{$tptc.description}</textarea>
    </div>
  </div>

  <div class="layui-form-item">
    <div class="layui-input-block">
	  <button class="layui-btn" lay-submit="" lay-filter="member_edit">立即提交</button>
      <button class="layui-btn layui-btn-primary" onclick="history.go(-1)">返回</button>
    </div>
  </div>
   </form>
	</div>
    <div class="layui-tab-item">
   <form class="layui-form">
  <input type="hidden" name="userid" value="{$tptc.userid}">
  <div class="layui-form-item">
    <label class="layui-form-label">登录验证</label>
    <div class="layui-input-block">
	  <input type="text" name="validate" value="{$tptc.validate}" placeholder="请输入内容" autocomplete="off" class="layui-input">
    </div>
  </div>
  <div class="layui-form-item">
    <div class="layui-input-block">
	  <button class="layui-btn" lay-submit="" lay-filter="member_edit">立即提交</button>
      <button class="layui-btn layui-btn-primary" onclick="history.go(-1)">返回</button>
    </div>
  </div>
   </form>
	</div>

   <div class="layui-tab-item">
   <form class="layui-form">
  <input type="hidden" name="userid" value="{$tptc.userid}">
  <div class="layui-form-item">
    <label class="layui-form-label">姓名</label>
    <div class="layui-input-block">
	  <input type="text" name="userxm" value="{$tptc.userxm}" placeholder="请输入内容" autocomplete="off" class="layui-input">
    </div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">身份证号</label>
    <div class="layui-input-block">
	  <input type="text" name="usersid" value="{$tptc.usersid}" placeholder="请输入内容" autocomplete="off" class="layui-input">
    </div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">认证图片</label>
	<a class="layui-btn" id="image" style="float: left;"><i class="layui-icon">&#xe67c;</i>上传图片</a>
    <div class="layui-input-block" style="margin-left: 220px;">
	  <input type="text" name="userzm" value="{$tptc.userzm}" class="layui-input" style="position: absolute;left: 0;top: 0;">
    </div>
  </div>

  <div class="layui-form-item">
	  <img style="margin-left: 110px;" id="userzm" src="__ROOT__{$tptc.userzm}">
  </div>

  <div class="layui-form-item">
    <div class="layui-input-block">
	  <button class="layui-btn" lay-submit="" lay-filter="member_edit">立即提交</button>
      <button class="layui-btn layui-btn-primary" onclick="history.go(-1)">返回</button>
    </div>
  </div>

   </form>
	</div>

	<div class="layui-tab-item">
   <form class="layui-form">
  <input type="hidden" name="userid" value="{$tptc.userid}">

  <div class="layui-form-item">
    <label class="layui-form-label">修改密码</label>
    <div class="layui-input-block">
	  <input type="password" name="password" required lay-verify="required" placeholder="请输入内容" autocomplete="off" class="layui-input">
    </div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">确认密码</label>
    <div class="layui-input-block">
	  <input type="password" name="passwords" required lay-verify="required" placeholder="请输入内容" autocomplete="off" class="layui-input">
    </div>
  </div>
  
  <div class="layui-form-item">
    <div class="layui-input-block">
	  <button class="layui-btn" lay-submit="" lay-filter="member_edits">立即提交</button>
      <button class="layui-btn layui-btn-primary" onclick="history.go(-1)">返回</button>
    </div>
  </div>

   </form>
	</div>

  </div>
</div>
   

</div>
</div>
<script>
layui.use(['form','element','upload'],function(){
  var form = layui.form,
  element = layui.element,
  upload = layui.upload,
  jq = layui.jquery;

  upload.render({
      url: '{:url("api/upload/upfile")}'
	,elem:'#image'
	,ext: 'jpg|png|gif'
	,area: ['500', '500px']
	,before: function(input){
	loading = layer.load(2, {
	shade: [0.2,'#000']
	});
	}
	,done: function(res){
	layer.close(loading);
	jq('input[name=userzm]').val(res.path);
	userzm.src = "__ROOT__"+res.path;
	layer.msg(res.msg, {icon: 1, time: 1000});
	}
  }); 
  
  //提交
  form.on('submit(member_edit)', function(data){
    loading = layer.load(2, {
      shade: [0.2,'#000']
    });
    var param = data.field;
    jq.post('{:url("member/edit")}',param,function(data){
      if(data.code == 200){
        layer.close(loading);
        layer.msg(data.msg, {icon: 1, time: 1000}, function(){
          location.href = '{:url("member/index")}';
        });
      }else{
        layer.close(loading);
        layer.msg(data.msg, {icon: 2, anim: 6, time: 1000});
      }
    });
    return false;
  });

  form.on('submit(member_edits)', function(data){
    loading = layer.load(2, {
      shade: [0.2,'#000']
    });
    var param = data.field;
    jq.post('{:url("member/edits")}',param,function(data){
      if(data.code == 200){
        layer.close(loading);
        layer.msg(data.msg, {icon: 1, time: 1000}, function(){
          location.href = '{:url("member/index")}';
        });
      }else{
        layer.close(loading);
        layer.msg(data.msg, {icon: 2, anim: 6, time: 1000});
      }
    });
    return false;
  });

})
</script>

{/block}